import { get, post, del, put } from "@/utils/request";
import { type AddParams, type ListData, type ListParams, type ListResult } from "./type";

export const getCheckRoomList = (data: ListParams) => {
  return get<ListParams, ListResult>("/api/checkRoom/list", data);
};

export const addCheckRoom = (data: AddParams) => {
  return post<AddParams, ListData>("/api/checkRoom/add", data);
};

export const updateCheckRoom = (data: AddParams) => {
  return put<AddParams, ListData>("/api/checkRoom/update", data);
};

export const delCheckRoom = (id: number) => {
  return del<null, null>(`/api/checkRoom/delete/${id}`);
};

export const delCheckRoomMany = (ids: number[]) => {
  return post<number[], null>("/api/checkRoom/deleteAll", ids);
};

export const getCheckRoomModel = (id: number) => {
  return get<null, ListData>(`/api/checkRoom/get/${id}`);
};
